<template>
	<div>Home组件--{{ count }}</div>
	<br>
	<br>
	num={{ num }}
	<br>
	<br>
	<button @click="incCount">触发方法改变count</button>
	<br>
	<br>
	<button @click="incActionCount">触发actions方法改变count</button>
</template>

<script lang="ts">
	import { defineComponent } from "vue";
	export default defineComponent({
		data() {
			return {};
		},
		computed: {
			count() : number {
				return this.$store.state.count;
			},
			num() : number {
				return this.$store.getters.num;
			}
		},
		methods: {
			incCount() : void {
				this.$store.commit("incCount")
			},
			incActionCount() : void {
				this.$store.dispatch("incCount")
			}
		}
	});
</script>

<style lang="scss"></style>